<!--suppress ALL -->
<include file="./Template/header.html" />


<link rel="stylesheet" type="text/css" href="/Template/css/recordList.css">
<script type="text/javascript">

	$(function() {

		//初始化页面配置
		document.title = "我的订单号码";

		var app = new Vue({
			el: '#container',
			data: {
				orderList: [],
			},
			methods: {
				index: indexPage,
				order: orderPage,
				rank: rankPage,
				center: centerPage,
			}
		})

		var pageNum = 2;
		var isNeedRefresh = false;

		$(window).scroll(function(){
			var scrollTop = $(this).scrollTop();
			var scrollHeight = $(document).height();
			var windowHeight = $(this).height();
			if(!isNeedRefresh &&
					(scrollHeight - scrollTop - windowHeight <= 25)){
				isNeedRefresh = true;
				refreshPage(pageNum++);
			}
		});

		function refreshPage(pageNum) {
			$.ajax({
				url:"/wechat/order/recordList",
				type:"post",
				data:{
					orderId: "{$order.order_id}",
					pageNum:pageNum,
				},
				dataType:"JSON",
				beforeSend:function(){
					$("#loadingToast").show();
				},
				complete:function(){
					$('#loadingToast').hide();
				},
				success:function(data){
					if(!isNullOrEmpty(data)) {
						app.orderList = app.orderList.concat(data);
						isNeedRefresh = false;
					}
				},
			})
		}

		$.ajax({
			url:"/wechat/order/recordList",
			type:"post",
			data:{
				orderId: "{$order.order_id}",
				pageNum:1,
			},
			dataType:"JSON",
			beforeSend:function(){
				$("#loadingToast").show();
			},
			complete:function(){
				$('#loadingToast').hide();
			},
			success:function(data){
				app.orderList = data;
			},
		})

	});


</script>
<div class="record-list">
	<div class="goods-info">
		<div class="goods-img" style="background: url('{$product.image}')no-repeat center;background-size: cover;"></div>
		<div class="goods">
			<p class="goods-title color-font">{$product.product_name}</p>
		</div>
		<div class="tag bg-yellow">
			<i></i>
			<span>第{$round.round_index}轮</span>
		</div>
	</div>
	<p class="record-title">本轮幸运码({$order.number})</p>
	<div class="record-num" v-for="order in orderList">
		<div>{{order.order_code}}</div>
	</div>
</div>


<!-- loading toast -->
<div id="loadingToast" class="weui_loading_toast" style="display: none;">
	<div class="weui_mask_transparent"></div>
	<div class="weui_toast small">
		<div class="weui_loading">
			<div class="weui_loading_leaf weui_loading_leaf_0"></div>
			<div class="weui_loading_leaf weui_loading_leaf_1"></div>
			<div class="weui_loading_leaf weui_loading_leaf_2"></div>
			<div class="weui_loading_leaf weui_loading_leaf_3"></div>
			<div class="weui_loading_leaf weui_loading_leaf_4"></div>
			<div class="weui_loading_leaf weui_loading_leaf_5"></div>
			<div class="weui_loading_leaf weui_loading_leaf_6"></div>
			<div class="weui_loading_leaf weui_loading_leaf_7"></div>
			<div class="weui_loading_leaf weui_loading_leaf_8"></div>
			<div class="weui_loading_leaf weui_loading_leaf_9"></div>
			<div class="weui_loading_leaf weui_loading_leaf_10"></div>
			<div class="weui_loading_leaf weui_loading_leaf_11"></div>
		</div>
		<p class="weui_toast_content">正在处理</p>
	</div>
</div>
<!--end loading toast-->
<div id="toastNothing" style="display: none;">
	<div class="weui_mask_transparent"></div>
	<div class="weui_toast">
		<i class="weui_icon_toast"></i>
		<p class="weui_toast_content color-fff">已到最底部</p>
	</div>
</div>
</body>
</html>